Skip to content

fix(filter): find HasConversion by the property path - #198

Merged
pdevito3 merged 1 commit into
mainfrom
backport/153
Oct 9, 2026
Merged

pdevito3 merged 1 commit into
mainfrom
backport/153

Conversation

@pdevito3

@pdevito3 pdevito3 commented Oct 9, 2026

Copy link
Copy Markdown
Owner

#169 found the conversion by the property path only where v1.14.2 threw. This change uses the property path for every HasConversion lookup, so a query name no longer changes how a converted property is filtered. A number, an enum, or a Guid is read by its own type, also without a query name. Before this change, that filter threw.

Behavior change: a null literal on a converted reference type matches null rows. A child path such as Email.Value on a converted parent with a query name compares the parent, like without a query name. A converted Guid gives a Guid constant in the expression text, and the rows are the same.

Examples (Email has HasConversion to string):
Email == null
before: compares with new EmailAddress("null"), 0 rows
after: compares with null, rows with a null Email
Email.Value == "a@x.com" (Email has a query name)
before: x.Email.Value == "a@x.com"
after: x.Email == new EmailAddress("a@x.com"), like without a query name
Number == 2 (Number is an int with HasConversion() and no query name)
before: ParsingException, inner InvalidOperationException: The binary operator Equal is not defined for the types 'System.Int32' and 'System.String'.
after: compares the int, 1 row

From #153 on v2.

#169 found the conversion by the property path only where v1.14.2 threw. This change uses the property path for every HasConversion lookup, so a query name no longer changes how a converted property is filtered. A number, an enum, or a Guid is read by its own type, also without a query name. Before this change, that filter threw.

Behavior change: a null literal on a converted reference type matches null rows. A child path such as Email.Value on a converted parent with a query name compares the parent, like without a query name. A converted Guid gives a Guid constant in the expression text, and the rows are the same.

Examples (Email has HasConversion to string):
  Email == null
    before: compares with new EmailAddress("null"), 0 rows
    after:  compares with null, rows with a null Email
  Email.Value == "a@x.com" (Email has a query name)
    before: x.Email.Value == "a@x.com"
    after:  x.Email == new EmailAddress("a@x.com"), like without a query name
  Number == 2 (Number is an int with HasConversion<string>() and no query name)
    before: ParsingException, inner InvalidOperationException: The binary operator Equal is not defined for the types 'System.Int32' and 'System.String'.
    after:  compares the int, 1 row

From #153 on v2.
@pdevito3
pdevito3 merged commit 4021a98 into main Oct 9, 2026
2 checks passed
@pdevito3
pdevito3 deleted the backport/153 branch October 9, 2026 20:38
pdevito3 added a commit that referenced this pull request Oct 9, 2026
Brings the fixes that landed on main (#175 to #198, #142, #118, #151, #165, #127) into v2. The v2 code already has each of these fixes, so each conflict keeps the v2 side.
IngbertPalm pushed a commit to IngbertPalm/QueryKit that referenced this pull request Oct 21, 2026
Sync the fork with the resynced upstream (34 commits) and keep the local
"Support array literals for converted properties" change on top of it.

Conflict in QueryKit/FilterParser.cs:
- Upstream pdevito3#198 merged the HasConversion lookup by query name and by
  property path into one branch and removed the else-if fallback and
  CreateStringConversionRightExpr. Took that structure and re-attached the
  in/not-in array handling (IsArrayLiteral, CreateStringConversionArrayExpr)
  in front of the inline null handling of the remaining branch.
- Split array items with SplitListItems instead of Split(','), so a comma
  inside a quoted item (upstream pdevito3#142) stays in the item. Added a unit test
  for it.

Unit tests (775) and integration tests (393) pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant